From: Ray Strode Date: Thu, 6 May 2021 13:32:48 +0000 (-0400) Subject: unlockDialog: Honor switch user lockdown settings X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~574^2^2~179 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=118d55699176b5a34b04d4bc4f7ab371fa4661dd;p=gnome-shell.git unlockDialog: Honor switch user lockdown settings At the moment user switching functionality is controlled by two settings: org.gnome.desktop.lockdown disable-user-switching for the panel when the session is unlocked, and org.gnome.desktop.screensaver user-switch-enabled for the unlock dialog when the session is locked. Having the lockdown setting not apply when the screen is locked is counterintuitive. This commit makes the unlock dialog honor both settings. Part-of: --- diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index 239e75ef5..370385abc 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -577,6 +577,10 @@ var UnlockDialog = GObject.registerClass({ this._userSwitchEnabledId = this._screenSaverSettings.connect('changed::user-switch-enabled', this._updateUserSwitchVisibility.bind(this)); + this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' }); + this._lockdownSettings.connect('changed::disable-user-switching', + this._updateUserSwitchVisibility.bind(this)); + this._userLoadedId = this._user.connect('notify::is-loaded', this._updateUserSwitchVisibility.bind(this)); @@ -858,7 +862,8 @@ var UnlockDialog = GObject.registerClass({ _updateUserSwitchVisibility() { this._otherUserButton.visible = this._userManager.can_switch() && - this._screenSaverSettings.get_boolean('user-switch-enabled'); + this._screenSaverSettings.get_boolean('user-switch-enabled') && + !this._lockdownSettings.get_boolean('disable-user-switching'); } cancel() {